﻿@{
    string currentLangId = Session["CultureInfo"] == null ? "zh-CN" : Convert.ToString(Session["CultureInfo"]);
    string currentLang = "中文";
    var languages = ShipWork.Models.LanguageModels.GetAllSupportLanguages();
    currentLang = languages.SingleOrDefault(d => d.Language_Id == currentLangId).Language_Name;
}
<div class="head">
    <a href="#">
        <img alt="掌娱无线logo" src="@Href("~/image/logo.jpg")" /></a>
    <div class="language">
        <a name="currentLang" href="#" class="pngfix1" onclick="LaguageShow();">@currentLang</a>
    </div>
    <div class="yuyan xl yuyanhidde">
        <div class="top">
        </div>
        <ul>
            @foreach (var item in languages)
            {
                <li>
                    @Html.ActionLink(item.Language_Name, "Language", "Shared", new { P = item.Language_Id }, new { Id = item.Language_Id })
                </li>
            }
        </ul>
        <img alt="" src="@Href("~/image/yuyan_bottom.gif")" />
    </div>
</div>
<div class="nav">
    <ul id="menu" class="menu">
        @foreach (var item in ShipWork.Models.MenuModels.GetChildMenusByPId("0"))
        {
            <li>
                @if (ShipWork.Models.MenuModels.GetChildMenusByPId(item.Menu_Id).Count() > 0)
                {
                    <span>@ShipWork.Models.ResourceGet.GetResValueByKey(item.Menu_Name)</span>

                    if (item.Menu_Id != "11")
                    {
                    <ul class='children'>
                        <li class="top"></li>
                        @foreach (var item1 in ShipWork.Models.MenuModels.GetChildMenusByPId(item.Menu_Id))
                        {
                            <li>
                                @if (!string.IsNullOrEmpty(item1.Controllor))
                                {
                                    @Html.ActionLink(@ShipWork.Models.ResourceGet.GetResValueByKey(item1.Menu_Name) ?? " ", item1.PageName, item1.Controllor)
                                }
                                else
                                {
                                    <a href="@Url.Content(item1.PageName ?? " ")">@ShipWork.Models.ResourceGet.GetResValueByKey(item1.Menu_Name)</a>
                                }
                            </li>
                        }
                        <li class="bottom"></li>
                    </ul>
                    }
                    else
                    {
                    <ul class='children'>
                        <li class="top"></li>
                        @{
                    
                        int i = 0;
                        foreach (var item1 in ShipWork.Models.MenuModels.GetChildMenusByPId(item.Menu_Id, "111"))
                        {
                            if (i > 0)
                            {
                            <li>
                                @Html.ActionLink(@ShipWork.Models.ResourceGet.GetResValueByKey(item1.Menu_Name), item1.PageName, item1.Controllor, new { P = item1.Parameters }, null)
                            </li>
                            }
                            else
                            {
                            <li class="lei">
                                 <span>@ShipWork.Models.ResourceGet.GetResValueByKey(item1.Menu_Name)</span>
                            </li>
                            }
                            i++;
                        } 
                        }
                        <li class="bottom"></li>
                    </ul>
                    <ul class='children' style="margin-left: 145px;">
                        <li class="top"></li>
                        @{

                        i = 0;
                        foreach (var item1 in ShipWork.Models.MenuModels.GetChildMenusByPId(item.Menu_Id, "113"))
                        {
                            if (i > 0)
                            {
                            <li>
                                @Html.ActionLink(@ShipWork.Models.ResourceGet.GetResValueByKey(item1.Menu_Name), item1.PageName, item1.Controllor, new { P = item1.Parameters }, null)
                            </li>
                            }
                            else
                            {
                            <li class="lei">
                                 <span>@ShipWork.Models.ResourceGet.GetResValueByKey(item1.Menu_Name)</span>
                            </li>
                            }
                            i++;
                        } 
                        }
                        <li class="bottom"></li>
                    </ul>
                    }
                }
                else
                {
                    @Html.ActionLink(@ShipWork.Models.ResourceGet.GetResValueByKey(item.Menu_Name), item.PageName, item.Controllor)
                }
            </li>
        }
    </ul>
</div>
